//-----------------------------------------------------------------------------
// Name: AnimateObject.h
// Auth: Dante Ratto, Robert Darty, & Paul Godfrey
// Desc: Handles the creation, destruction and updating of a AnimateObject
//-----------------------------------------------------------------------------

#ifndef _ANIMATEOBJECT_
#define _ANIMATEOBJECT_

#include "SharedConstants.h"
#include "Bounding.h"

#include <vector>

//-----------------------------------------------------------------------------
// cAnimateObject:
//-----------------------------------------------------------------------------
class cAnimateObject
{
public:
	// Constructors:
	cAnimateObject();
	~cAnimateObject();

	// cAnimateObject Methods:

	//-----------------------------------------------------------------------------
	void SetType(enum eObjectType);
	// Desc: Sets what the object is

	//-----------------------------------------------------------------------------
	enum eObjectType GetType();
	// Desc: Gets what the object is
	
	//-----------------------------------------------------------------------------
	void Draw(enum eObjectType);
	// Desc: Renders the specified AnimateObject at its current position
	
	//-----------------------------------------------------------------------------
	void Move(tVector3f&);
	// Desc: Changes the position in the 3d space that the AnimateObject will be at.

	void UpdateHeads(float x, float y, float z, float r, int pos, float yaw, float bX, float bZ);
	//-----------------------------------------------------------------------------
	void Move(float, float, float);
	// Desc: Changes the position in the 3d space that the AnimateObject will be at.

	//-----------------------------------------------------------------------------
	void Attack(int);
	// Desc: Spawns bullets based on weapon

	//-----------------------------------------------------------------------------
	void Infect();
	// Desc: Infects target

	//-----------------------------------------------------------------------------
	void Die( float );
	// Desc: Death animation

	//-----------------------------------------------------------------------------

	//-----------------------------------------------------------------------------
	void SetDead( bool );
	// Desc: sets dead status

	//-----------------------------------------------------------------------------

	//-----------------------------------------------------------------------------
	bool GetDead();
	// Desc: Gets dead status

	//-----------------------------------------------------------------------------
	void UpdateHealth(int);
	// Desc: Updates health

	//-----------------------------------------------------------------------------
	int GetHealth();
	// Desc: Gets health of AnimateObject

	//-----------------------------------------------------------------------------
	void SetHealth(int);
	// Desc: Sets health of AnimateObject

	//-----------------------------------------------------------------------------
	float GetSpeed();
	// Desc: Gets speed of AnimateObject

	//-----------------------------------------------------------------------------
	void SetSpeed(float);
	// Desc: Sets speed of AnimateObject

	//-----------------------------------------------------------------------------
	int GetDamage();
	// Desc: Gets damage

	//-----------------------------------------------------------------------------
	void SetDamage(int);
	// Desc: Sets damage

	//-----------------------------------------------------------------------------
	float GetYaw();
	// Desc: Gets yaw

	//-----------------------------------------------------------------------------
	void SetYaw(float);
	// Desc: Sets yaw

	//-----------------------------------------------------------------------------
	float GetPitch();
	// Desc: Gets pitch

	//-----------------------------------------------------------------------------
	void SetPitch(float);
	// Desc: Sets pitch

	//-----------------------------------------------------------------------------
	int GetStatus();
	// Desc: Gets if infected, normal, or vaccinated

	//-----------------------------------------------------------------------------
	void SetStatus(int);
	// Desc: Sets if infected, normal, or vaccinated

	//-----------------------------------------------------------------------------
	float GetPositionX();
	// Desc: Gets X position

	//-----------------------------------------------------------------------------
	float GetPositionY();
	// Desc: Gets Y position

	//-----------------------------------------------------------------------------
	float GetPositionZ();
	// Desc: Gets Z position

	//-----------------------------------------------------------------------------
	void SetPosition(tVector3f&);
	// Desc: Sets the position in the 3d space that the AnimateObject will be at.

	//-----------------------------------------------------------------------------
	void SetPosition(float, float, float);
	// Desc: Sets the position in the 3d space that the AnimateObject will be at.

	//-----------------------------------------------------------------------------
	int GetColor();
	// Desc: Gets color of AnimateObject

	//-----------------------------------------------------------------------------
	void SetColor(const tVector3f&);
	// Desc: Sets color of AnimateObject with 3 floats

	//-----------------------------------------------------------------------------
	void SetColor(const tVector6f&);
	// Desc: Sets color of AnimateObject with 6 floats

	//-----------------------------------------------------------------------------
	float GetRandomX();
	// Desc: Gets first random float

	//-----------------------------------------------------------------------------
	float GetRandomY();
	// Desc: Gets second random float

	//-----------------------------------------------------------------------------
	float GetRandomZ();
	// Desc: Gets third random float

	//-----------------------------------------------------------------------------
	float GetOffsetX();
	// Desc: Gets offset in X direction
	
	//-----------------------------------------------------------------------------
	float GetOffsetZ();
	// Desc: Gets offset in Z direction

	//-----------------------------------------------------------------------------
	void SetOffsetX(float);
	// Desc: Sets offset in the X direction
	
	//-----------------------------------------------------------------------------
	void SetOffsetZ(float);
	// Desc: Sets offset in the Z direction

	//-----------------------------------------------------------------------------
	void SetRandomX(float, float);
	// Desc: Sets first random float

	//-----------------------------------------------------------------------------
	void SetRandomY(float);
	// Desc: Sets second random float

	//-----------------------------------------------------------------------------
	void SetRandomZ(float, float);
	// Desc: Sets third random float

	//-----------------------------------------------------------------------------
	void Update(float);
	// Desc: Calculates movement for animate (including collisions with inanimates)

	//-----------------------------------------------------------------------------
	void Rotate(float);
	// Desc: rotates animate objects for death

	//----------------------------------------------------------------------------
	void DrawBoss();
	//  Desc: Draws Final Boss...

	//----------------------------------------------------------------------------
	void UpdateBossHead(float dist, float yaw, int pos, float height);
	//Desc: Updates the boss's head locations

	//-----------------------------------------------------------------------------
	void DrawHuman();
	// Desc: Draws a human

	//----------------------------------------------------------------------------
	void DrawDeadHuman();
	// Desc: Draws a dead uhman

	//-----------------------------------------------------------------------------
	void DrawCow();
	// Desc: Draws a cow

	//-----------------------------------------------------------------------------
	void SetDirection(tVector3f);
	// Desc: Sets the facing direction

	//-----------------------------------------------------------------------------
	float GetDirectionX();
	// Desc: Gets X direction
	
	//-----------------------------------------------------------------------------
	float GetDirectionY();
	// Desc: Gets Y Direction
	
	//-----------------------------------------------------------------------------
	float GetDirectionZ();
	// Desc: Gets Z Direction

	//-----------------------------------------------------------------------------
	void AddBody(float, float, float, float);
	// Desc: Adds a bounding box to the body array

	//-----------------------------------------------------------------------------
	void UpdateBody(float, float, float, float, int);
	// Desc: Updates the location of a body bounding box

	//-----------------------------------------------------------------------------
	void UpdateCowBody(float,float, int);
	// Desc: Updates the locations of a cow's body bounding box

	//----------------------------------------------------------------------------
	void SetBossHeadStatus(int);
	// Desc: Sets the status of a boss head

	//-----------------------------------------------------------------------------
	void UpdateCowHead(float);
	//Desc: Updates location of cow head

	//----------------------------------------------------------------------------
	bool GetVictoryStatus();
	// Desc: Gets the Status of victory

	//-----------------------------------------------------------------------------
	cBounding* GetBoundingHead();
	// Desc: Gets head bounding box

	//-----------------------------------------------------------------------------
	cBounding* GetBoundingMaster();
	// Desc: Gets master bounding box

	//-----------------------------------------------------------------------------
	std::vector<cBounding>* GetBoundingBody();
	// Desc: Gets body bounding boxes
	
private:
	// Members:
	int mHealth;
	int mDamage;
	int mStatus;
	int mUp;

	bool mBossHead1Status;
	bool mBossHead2Status;
	bool mBossHead3Status;
	bool mBossHead4Status;
	bool mBossHead5Status;
	bool mBossHead6Status;
	bool mBossHead7Status;
	bool mBossHead8Status;

	bool mVictoryStatus;

	enum eObjectType mType;

	float mSpeed;
	float mYaw;
	float mPitch;
	float mOffsetX;
	float mOffsetZ;
	float mRotate;
	
	bool mDead;
	bool mFirst;

	tVector3f mPosition;
	tVector6f mColor;
	tVector3f mRandom;
	tVector3f mDirection;
	
	std::vector<cBounding> mBody;

	cBounding mMaster;
	cBounding mHeadBounding;	
};

//-----------------------------------------------------------------------------
// Functions:
//-----------------------------------------------------------------------------
cAnimateObject* GetAnimateObject();

#endif
